package org.example.entity;

import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.print.attribute.standard.DateTimeAtCompleted;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="user_data")
@Cacheable
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class DataModel extends AbstractCodeModel
{
  private String data;
  private Date ts;
  private UserModel owner;


  public DataModel()
  {
    super();
    // TODO Auto-generated constructor stub
  }

  @Basic(optional=true)
  @Column(nullable=true, name = "data")
  public String getData()
  {
    return data;
  }


  public void setData(String data)
  {
    this.data = data;
  }

  @Basic(optional=true)
  @Column(nullable=true, name = "ts")
  public Date getTs()
  {
    return ts;
  }


  public void setTs(Date ts)
  {
    this.ts = ts;
  }

  @ManyToOne(optional=false)
  @JoinColumn(name="owner", nullable=false, updatable=false)
  public UserModel getOwner()
  {
    return owner;
  }

  public void setOwner(UserModel owner)
  {
    this.owner = owner;
  }

}
